//Component Object
import router from '@src/router'
import {
  storeBindingsBehavior
} from "mobx-miniprogram-bindings";
import base from "@src/store/base";
Component({
  behaviors: [storeBindingsBehavior],
  storeBindings: [{
    store: base,
    fields: ['themeColor', 'themeTitleColor']
  }],
  properties: {
    isShow: {
      type: Boolean,
      value: false,
      observer(v) {
        const that = this
        wx.getSystemInfo({
          success: function (res) {
            that.setData({
              windowWidth: res.windowWidth,
              windowHeight: res.windowHeight,
              isShowModal: v
            })
          },
        })
      }
    },
    isSucceed: {
      type: Boolean,
      value: false
    },
    errRemark: {
      type: String,
      value: ''
    },
    formData: {
      type: Object,
    }

  },
  data: {
    isShowModal: false,
    windowWidth: '',
    windowHeight: '',
  },
  methods: {
    handerOk() {
      this.setData({
        isShowModal: false
      })
      this.triggerEvent('onOver', false);
      // const path = this.data.formData.fapiaoId ? 'invoiceHistory' : 'invoice'
      // router.push({
      //   path: `code-order/pages/${path}/main`
      // })
      router.back()
    }
  }
});